//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.payment;

import java.io.Serializable;
import java.math.BigDecimal;

public class Payment
        implements Serializable {

    public Payment() {
    }

    public Payment(Integer id, String prefix, String pieceId, BigDecimal montant, String mode, String numero, String date,
            String pointage, String updateLastTime, String userId) {
        setId(id);
        setPrefix(prefix);
        setPieceId(pieceId);
        setMontant(montant);
        setMode(mode);
        setNumero(numero);
        setDate(date);
        setPointage(pointage);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
    }

    public Payment(Payment otherData) {
        setId(otherData.getId());
        setPrefix(otherData.getPrefix());
        setPieceId(otherData.getPieceId());
        setMontant(otherData.getMontant());
        setMode(otherData.getMode());
        setNumero(otherData.getNumero());
        setDate(otherData.getDate());
        setPointage(otherData.getPointage());
        setUpdateLastTime(otherData.getUpdateLastTime());
        setUserId(otherData.getUserId());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPieceId(String pieceId) {
        this.pieceId = pieceId;
    }

    public String getPieceId() {
        return pieceId;
    }

    public void setMontant(BigDecimal montant) {
        this.montant = montant;
    }

    public BigDecimal getMontant() {
        return montant;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public String getMode() {
        return mode;
    }

    public void setNumero(String numero) {
        this.numero = numero;
    }

    public String getNumero() {
        return numero;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getDate() {
        return date;
    }

    public void setPointage(String pointage) {
        this.pointage = pointage;
    }

    public String getPointage() {
        return pointage;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "prefix=" + getPrefix() + " " + "pieceId=" + getPieceId() + " " + "montant=" + getMontant() + " " + "mode=" + getMode() + " " + "numero=" + getNumero() + " " + "date=" + getDate() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "userId=" + getUserId() + " " + "pointage=" + getPointage());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Payment) {
            Payment lTest = (Payment) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (prefix == null) {
                lEquals = lEquals && lTest.prefix == null;
            } else {
                lEquals = lEquals && prefix.equals(lTest.prefix);
            }
            if (pieceId == null) {
                lEquals = lEquals && lTest.pieceId == null;
            } else {
                lEquals = lEquals && pieceId.equals(lTest.pieceId);
            }
            if (montant == null) {
                lEquals = lEquals && lTest.montant == null;
            } else {
                lEquals = lEquals && montant.equals(lTest.montant);
            }
            if (mode == null) {
                lEquals = lEquals && lTest.mode == null;
            } else {
                lEquals = lEquals && mode.equals(lTest.mode);
            }
            if (numero == null) {
                lEquals = lEquals && lTest.numero == null;
            } else {
                lEquals = lEquals && numero.equals(lTest.numero);
            }
            if (date == null) {
                lEquals = lEquals && lTest.date == null;
            } else {
                lEquals = lEquals && date.equals(lTest.date);
            }
            if (pointage == null) {
                lEquals = lEquals && lTest.pointage == null;
            } else {
                lEquals = lEquals && pointage.equals(lTest.pointage);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (prefix == null ? 0 : prefix.hashCode());
        result = 37 * result + (pieceId == null ? 0 : pieceId.hashCode());
        result = 37 * result + (montant == null ? 0 : montant.hashCode());
        result = 37 * result + (mode == null ? 0 : mode.hashCode());
        result = 37 * result + (numero == null ? 0 : numero.hashCode());
        result = 37 * result + (date == null ? 0 : date.hashCode());
        result = 37 * result + (pointage == null ? 0 : pointage.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        return result;
    }
    private Integer id;
    private String prefix;
    private String pieceId;
    private BigDecimal montant;
    private String mode;
    private String numero;
    private String date;
    private String pointage;
    private String updateLastTime;
    private String userId;
}
